package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="system_article_cat" )
public class SystemArticleCat extends BaseObject implements Serializable {
    private Long catId;
    private String catDescription;
    private String catKeywords;
    private String catName;
    private byte catType;
    private Long parentId;
    private boolean showInNav;
    private byte showOrder;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getCatId() {
        return this.catId;
    }
    
    public void setCatId(Long catId) {
        this.catId = catId;
    }
    
    @Column(name="cat_description", nullable=false)
    public String getCatDescription() {
        return this.catDescription;
    }
    
    public void setCatDescription(String catDescription) {
        this.catDescription = catDescription;
    }
    
    @Column(name="cat_keywords", nullable=false)
    public String getCatKeywords() {
        return this.catKeywords;
    }
    
    public void setCatKeywords(String catKeywords) {
        this.catKeywords = catKeywords;
    }
    
    @Column(name="cat_name", nullable=false)
    public String getCatName() {
        return this.catName;
    }
    
    public void setCatName(String catName) {
        this.catName = catName;
    }
    
    @Column(name="cat_type", nullable=false)
    public byte getCatType() {
        return this.catType;
    }
    
    public void setCatType(byte catType) {
        this.catType = catType;
    }
    
    @Column(name="parent_id", nullable=false)
    public Long getParentId() {
        return this.parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    
    @Column(name="show_in_nav", nullable=false)
    public boolean isShowInNav() {
        return this.showInNav;
    }
    
    public void setShowInNav(boolean showInNav) {
        this.showInNav = showInNav;
    }
    
    @Column(name="show_order", nullable=false)
    public byte getShowOrder() {
        return this.showOrder;
    }
    
    public void setShowOrder(byte showOrder) {
        this.showOrder = showOrder;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemArticleCat pojo = (SystemArticleCat) o;

        if (catDescription != null ? !catDescription.equals(pojo.catDescription) : pojo.catDescription != null) return false;
        if (catKeywords != null ? !catKeywords.equals(pojo.catKeywords) : pojo.catKeywords != null) return false;
        if (catName != null ? !catName.equals(pojo.catName) : pojo.catName != null) return false;
         if (parentId != null ? !parentId.equals(pojo.parentId) : pojo.parentId != null) return false;
        if (showInNav != pojo.showInNav) return false;
 
        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (catDescription != null ? catDescription.hashCode() : 0);
        result = 31 * result + (catKeywords != null ? catKeywords.hashCode() : 0);
        result = 31 * result + (catName != null ? catName.hashCode() : 0);
         result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
        result = 31 * result + (showInNav ? 1 : 0);
 
        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("catId").append("='").append(getCatId()).append("', ");
        sb.append("catDescription").append("='").append(getCatDescription()).append("', ");
        sb.append("catKeywords").append("='").append(getCatKeywords()).append("', ");
        sb.append("catName").append("='").append(getCatName()).append("', ");
        sb.append("catType").append("='").append(getCatType()).append("', ");
        sb.append("parentId").append("='").append(getParentId()).append("', ");
        sb.append("showInNav").append("='").append(isShowInNav()).append("', ");
        sb.append("showOrder").append("='").append(getShowOrder()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
